package com.jcxh.sg_exam.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jcxh.sg_exam.pojo.Kaochang;
import com.jcxh.sg_exam.pojo.vo.UserScoreVo;
import com.jcxh.sg_exam.pojo.vo.UserVo;
import com.jcxh.sg_exam.service.KaochangService;
import com.jcxh.sg_exam.mapper.KaochangMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lenovo
 * @description 针对表【kaochang】的数据库操作Service实现
 * @createDate 2024-08-09 09:54:53
 */
@Service
public class KaochangServiceImpl extends ServiceImpl<KaochangMapper, Kaochang>
        implements KaochangService {

    @Autowired
    KaochangMapper kaochangMapper;

    @Override
    public Map<String, Object> distributionQueryUsers(Integer currentPage, Integer pageSize, String name, String idNumber, String workUnit) {

        PageHelper.startPage(currentPage, pageSize);

        Page<UserVo> page = kaochangMapper.query(name, idNumber, workUnit);

        List<UserVo> result = page.getResult();
        long total = page.getTotal();
        Map<String,Object> map=new HashMap<>();
        map.put("records",result);
        map.put("total",total);
        return map;


    }



}




